﻿using SAPInvoker.Reflector;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace TestProject
{
    
    
    /// <summary>
    ///This is a test class for GetSAPInvokerDataControllerTest and is intended
    ///to contain all GetSAPInvokerDataControllerTest Unit Tests
    ///</summary>
    [TestClass()]
    public class GetSAPInvokerDataControllerTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion
 

        /// <summary>
        ///A test for GetInokerObject
        ///</summary>
        [TestMethod()]
        public void GetInokerObjectTest()
        {
            GetSAPInvoker target = new GetSAPInvoker(); // TODO: Initialize to an appropriate value
            // object expected = null; // TODO: Initialize to an appropriate value
            RFCParametersInfo actual;
            actual = target.GetRFCParametersInfo("ZRFC_GET_SALES_DSPI");
            Assert.AreEqual(actual.InParams.Count, 5);
            Assert.AreEqual(actual.OutParams.Count, 0);
            Assert.AreEqual(actual.TableParams.Tables.Count, 1);
            Assert.AreEqual(actual.TableParams.Tables[0].TableName, "ZDSPIMASTER");
            //Assert.AreEqual(actual.TableParams.Tables[1].TableName, "FIELDS");
            //Assert.AreEqual(actual.TableParams.Tables[2].TableName, "OPTIONS");
        }
    }
}
